package cn.com.server.extend.model;

import java.io.Serializable;

import cn.com.server.common.util.Underline2CamelUtil;

/**
 * 分页查询基础类
 * @author admin
 *
 */
@SuppressWarnings("serial")
public class BasePageModel implements Serializable{
	
	/**
	 * 当前页
	 */
	private Integer page;
	
	/**
	 * 页大小
	 */
	private Integer limit;
	
	/**
	 * 排序列
	 */
	private String orderField;
	
	/**
	 * 排序升价序号
	 */
	private String orderType;
	
	/**
	 * 通用查询条件
	 */
	private String searchModel;

	public Integer getPage() {
		page = (page==null||page<1)?1:page;
		return page;
	}

	public void setPage(Integer page) {
		
		page = (page==null||page<1)?1:page;
		this.page = page;
	}

	public Integer getLimit() {
		limit = (limit==null||limit<1)?10:limit;
		return limit;
	}

	public void setLimit(Integer limit) {
		limit = (limit==null||limit<1)?10:limit;
		this.limit = limit;
	}

	public String getOrderField() {
		return orderField;
	}

	public void setOrderField(String orderField) {
		orderField = Underline2CamelUtil.camel2Underline(orderField);
		this.orderField = orderField;
	}

	public String getOrderType() {
		return orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public String getSearchModel() {
		return searchModel;
	}

	public void setSearchModel(String searchModel) {
		this.searchModel = searchModel;
	}
}
